<?php

/**
 * ExtRowExpanderBase class file
 *
 * @author TrueSoftware B.V. (The Netherlands)
 * @link http://www.ext4yii.com
 * @copyright Copyright 2007-2010 TrueSoftwareB.V. all rights reserved.
 * @license http://www.ext4yii.com/license/
 *          EVALUATION VERSION - NOT FOR COMMERCIAL USE OR DISTRIBUTION.
 * @version 0.7.2
 */
abstract class ExtGridRowExpanderColumnBase extends ExtDeclaredPluginItemBase
{

    public function init()
    {
        parent::init();
        $this->getController()->addUxScript('RowExpander.js');
    }

    public function parseNode(ExtHTMLParserNode $node, ExtASTWalker $astwalker)
    {
        parent::parseNode($node, $astwalker);
        $this->parseXTemplate('template', 'tpl', $node, $astwalker);
        $this->getController()->addBeforeInitScript(
                sprintf('var %s=%s', $this->getId(), parent::renderConfig(true))
        );
        $node->shiftUp();
    }

    //override
    protected function  configureClientIDs($registerID = true, $makeGlobal = true)
    {
        parent::configureClientIDs(false, false);
    }

    public function renderConfig($asobject=true)
    {
        if ($this->parent->parent instanceof ExtGridPanel)
        {
            $this->parent->parent->addedPlugins[] = $this->getId();
            return $this->getId();
        }
        else
            return parent::renderConfig($asobject);
    }

}

?>
